using System;
using System.Collections.Generic;
using System.Text;
using SchEdu.Framework.DataModel;
using SchEdu.Framework.Exceptions;

namespace SchEdu.Framework.Validators
{
    public class OperationSequenceNoValidator : Validator
    {
        public OperationSequenceNoValidator(SchEduData schEduData)
            : base(schEduData)
        {
        }

        #region IValidator Members

        public override void Validate()
        {
            foreach (SchEduDataSet.OrderRow order in SchEduData.Order)
            {
                foreach (SchEduDataSet.OperationRow operation in order.GetOperationRows())
                {
                    if (operation.IsSequenceNoNull() == true)
                    {
                        throw new ValidatorException(string.Format(Resources.NoSequenceNo, order.OrderNo, operation.OperationNo));
                    }
                }
            }
        }

        #endregion
    }
}
